﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GPM
{ 
    public class ButtonExtFormat : IFormatProvider, ICustomFormatter
    {
        string _condition1 = "否";
        string _condition2 = "是";

        public object GetFormat(Type formatType)
        {
            return this;
        }

        public string Format(string format, object arg, IFormatProvider formatProvider)
        {
            if (arg.ToString() == "0")
                return _condition1;
            if (arg.ToString() == "1")
                return _condition2;
            return arg.ToString();
        }
    }
}
